package generators;

import java.util.*;

public class TestSuiteGenerator_NoAssert
{
  protected static String nl;
  public static synchronized TestSuiteGenerator_NoAssert create(String lineSeparator)
  {
    nl = lineSeparator;
    TestSuiteGenerator_NoAssert result = new TestSuiteGenerator_NoAssert();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "package tests.gen;" + NL + "" + NL + "import java.util.*;" + NL + "import junit.framework.Assert;" + NL + "import org.junit.Test;" + NL + "import program.ShapeClassifier;" + NL + "" + NL + "" + NL + "public class ";
  protected final String TEXT_2 = " {" + NL + "\tShapeClassifier c = new ShapeClassifier();" + NL + "\t" + NL + "\t";
  protected final String TEXT_3 = NL + "\t" + NL + "\t@Test" + NL + "\tpublic void test";
  protected final String TEXT_4 = "(){ " + NL + "\t\tString output = c.evaluateGuess(\"";
  protected final String TEXT_5_0 = "\");";
  protected final String TEXT_5_0_1 = NL + "\t\tSystem.out.println(\"test:";
  protected final String TEXT_5_0_1_2 = "\" + \" \" + output);"; 
  protected final String TEXT_5_2 = NL + "\t}";
  protected final String TEXT_5 = "\");" + NL + "\t}" + NL + "\t" + NL + "\t";
  
  protected final String TEXT_6 = NL + "}";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(((Object[])argument)[0]);
    stringBuffer.append(TEXT_2);
    
		for(int i=0;i<((List<String>)((Object[])argument)[1]).size();i++){
	
    stringBuffer.append(TEXT_3);
    stringBuffer.append(i);
    stringBuffer.append(TEXT_4);//
    stringBuffer.append(((List<String>)((Object[])argument)[1]).get(i));
    stringBuffer.append(TEXT_5_0);
    stringBuffer.append(TEXT_5_0_1);
    stringBuffer.append(i);
    stringBuffer.append(TEXT_5_0_1_2);
    stringBuffer.append(TEXT_5_2);
    }
    stringBuffer.append(TEXT_6);
    return stringBuffer.toString();
  }
}
